﻿using gt.dotnetcore.webapi.extensions.ApiResults;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;

namespace gt.dotnetcore.webapi.extensions
{
    public class ApiControllerBase : ControllerBase
    {
        public SuccessResult<string> Success()
        {
            return new SuccessResult<string>(string.Empty);
        }
        public static SuccessResult<T> Success<T>(T data)
        {
            return new SuccessResult<T>(data);
        }
        public static ErrorResult Error(int code, string errorMsg)
        {
            return new ErrorResult(code, errorMsg);
        }
    }
}
